package cn.z2huo.knowledge.concurrency.callable.callable;

import cn.hutool.core.thread.ThreadUtil;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

/**
 * <p>
 *
 * @author z2huo
 */
class MyCallable implements Callable<String> {

    private final int id;

    public MyCallable(int id) {
        this.id = id;
    }

    @Override
    public String call() {
        ThreadUtil.sleep(5, TimeUnit.SECONDS);
//        if (id == 5) {
//            ThreadUtil.sleep(5, TimeUnit.SECONDS);
//        }
        return "result is " + id;
    }
}
